<div>
    <table class="table table-hover">
        <thead>
        <tr>
            <th width="25%">服务版本</th>
            <th width="15%">状态</th>
            <th width="15%">容器概况</th>
            <th width="30%">应用镜像</th>
            <th width="20%">创建时间</th>
            <th width="5%">更多</th>
        </tr>
        </thead>
        <tbody>
        <tr ng-repeat-start="elem in ser.verTable">
            <td>
                <div ng-switch="elem.state">
                    <div ng-switch-default><a ui-sref="k8s-service-detail.pod({kDbCode: elem.k8sCode,
                                   namesp: elem.namespace, name: elem.rcName, appId: ser.appId})">{{::elem.rcName}}</a>
                    </div>
                    <div ng-switch-when="002">{{::elem.rcName}}</div>
                </div>
                <span class="text-danger" ng-switch-default>N/A</span>
            </td>
            <td ng-switch="elem.releaseState">
                <span class="text-primary" ng-switch-when="001"><i class="margin-right-5 fa fa-cog fa-spin"/>发布中</span>
                <span class="text-primary" ng-switch-when="000"><i class="margin-right-5 fa fa-cog fa-spin"/>滚动升级</span>
                <div class="text-success" ng-switch-when="002" ng-switch="elem.state">
                    <span class="text-success" ng-switch-when="001">启用</span>
                    <span class="text-danger" ng-switch-when="002">停用</span>
                    <span ng-switch-when="loading"><div class="loading-sm"></div></span>
                </div>
                <span class="text-danger" ng-switch-when="003"><i class="margin-right-5 fa fa-times"/>发布失败</span>
            </td>
            <td ng-switch="elem.state">
                <div ng-switch-when="002"><span class="text-danger">N/A</span></div>
                <div ng-switch-default ng-switch="elem.podInfo.loading">
                    <div ng-switch-when="true">
                        <div class="loading-sm"></div>
                    </div>
                    <div ng-switch-when="false">
                        <ul class="list-inline">
                            <li ui-tooltip="{{elem.podInfo.running}} Running" class="text-success">
                                <i class="fa fa-circle"></i> {{elem.podInfo.running}}
                            </li>
                            <li ui-tooltip="{{elem.podInfo.pending}} Pending" class="text-warning">
                                <i class="fa fa-circle"></i> {{elem.podInfo.pending}}
                            </li>
                            <li ui-tooltip="{{elem.podInfo.failed}} Failed" class="text-danger">
                                <i class="fa fa-circle"></i> {{elem.podInfo.failed}}
                            </li>
                        </ul>
                    </div>
                </div>
            </td>
            <td>
                <a style="font-size: 12px; font-weight: bold"
                   ui-sref="docker-image-detail({imageId: elem.imageFileId})"
                   title="{{::elem.imageName}}:{{::elem.imageVersion}}">{{::elem.imageName}}:{{::elem.imageVersion}}</a>
            </td>
            <td>{{::elem.createTime | date: 'yyyy-MM-d HH:mm:ss'}}</td>
            <td class="text-center more-action">
                <div uib-dropdown>
                    <a uib-dropdown-toggle><i class="fa fa-ellipsis-h fa-lg"/></a>
                    <ul class="dropdown-menu animate fade-in-down" style="margin-bottom: 30px">
                        <li ng-if="elem.state == '001' && elem.releaseState == '002'">
                            <a ng-click="ver.stopVer(elem)"><i class="fa fa-pause"></i><span class="pull-right">停用</span></a></li>
                        <li  ng-if="elem.state == '002' && elem.releaseState == '002'">
                            <a ng-click="ver.startVer(elem)"><i class="fa fa-play"></i><span class="pull-right">启用</span></a></li>
                        <li ng-if="elem.state == '002'">
                            <a ng-click="ver.deleteVer(elem)"><i class="fa fa-times fa-lg"></i><span class="pull-right">移除</span></a></li>
                        <li ng-if="elem.releaseState != '000' && elem.releaseState != '001'">
                            <a ui-sref="app-service-version-publish.deploy({appId: ser.appId, k8sCode: elem.k8sCode, serId:ser.serviceId, verId: elem.versionId,namespace: dtl.namespace})">
                                <i class="fa fa-pencil"></i><span class="pull-right">编辑</span></a></li>
                        <li ng-if="elem.releaseState == '002'">
                            <a ng-click="ver.openAdvanceForm(ser, $index)">
                                <i class="fa fa-bolt fa-lg"></i><span class="pull-right">高级配置</span></a></li>
                        <li ng-if="elem.releaseState == '002' && elem.state == '001'">
                            <a ui-sref="app-service-version-publish.deploy({appId: ser.appId, k8sCode: elem.k8sCode, rolVerId: elem.versionId, serId:ser.serviceId})">
                                <i class="fa fa-wrench"></i><span class="pull-right">滚动升级</span></a></li>
                        <li>
                            <a ng-click="ver.openLogForm(elem)"><i class="fa fa-file-text"></i><span class="pull-right">查看Yaml</span></a></li>
                    </ul>
                </div>
            </td>
        </tr>
        <tr ng-repeat-end ng-if="elem.releaseState == '003'">
            <td colspan="6" class="text-danger">
                <i class="fa fa-exclamation-circle margin-right-10"></i>{{::elem.releaseDesc}}
            </td>
        </tr>
        </tbody>
    </table>
    <!--Loading-->
    <div class="loading" ng-show="!ser.verTable"></div>
</div>